﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	SearchResult
</asp:Content>
<script runat="server">

    
    public void Page_Load()
    {
        GridView1.DataSource = ViewData["searchResult"];
        GridView1.DataBind();
       foreach (GridViewRow gvr in GridView1.Rows)
        {
           ((HyperLink)gvr.Cells[5].Controls[0]).NavigateUrl = "~/Search/ViewDetails?type=" +
                                 "&hotelName=" + gvr.Cells[0].Text.ToString() +
                                   "&branchName=" + gvr.Cells[1].Text.ToString() +
                                   "&country=" + gvr.Cells[2].Text.ToString();
       }
    }

   
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
       
    }
</script>
 

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

   <form id="form1" runat="server">
    <h2><%: ViewData["Message"] %></h2>
      
        <asp:GridView ID="GridView1" runat="server" 
        Height="200px" Width="1098px" CellPadding="3" BackColor="White" 
        BorderColor="#999999" BorderStyle="None" BorderWidth="1px" 
        GridLines="Vertical" AutoGenerateColumns="False" style="margin-left: 4px" >
            <AlternatingRowStyle BackColor="#DCDCDC" />
            <Columns>
                <asp:BoundField DataField="Hotel" HeaderText="Hotel Name" />
                <asp:BoundField DataField="Branch" HeaderText="Branch" />
                <asp:BoundField DataField="Country" HeaderText="Country" />
                <asp:BoundField DataField="Address" HeaderText="Address " />
                <asp:BoundField DataField="District" HeaderText="District" />
                <asp:HyperLinkField Text="View" />
            </Columns>
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <PagerStyle ForeColor="Black" HorizontalAlign="Center" BackColor="#999999" />
            <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#0000A9" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#000065" />
        </asp:GridView>
    
    </form>
 </asp:Content>

 